package service

import (
	"gitee/yinlai/kms-backend/controllers/service"
	"github.com/gin-gonic/gin"
)

// 实现添加集群
func create(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/create", service.Create)
}

// 更新集群
func update(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/update", service.Update)
}

// 删除
func delete(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/delete", service.Delete)
}

// 删除列表
func deleteList(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/deleteList", service.DeleteList)
}

// 获取
func get(serviceGroup *gin.RouterGroup) {
	serviceGroup.GET("/get", service.Get)
}

// 获取集群列表
func list(serviceGroup *gin.RouterGroup) {
	serviceGroup.GET("/list", service.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	serviceGroup := g.Group("/service")
	create(serviceGroup)
	update(serviceGroup)
	delete(serviceGroup)
	get(serviceGroup)
	list(serviceGroup)
	deleteList(serviceGroup)
}
